/**
*
*  文字形状文件
*
*/

function Shape(x, y, texte){
        this.x = x;
        this.y = y;
        this.size = 100;
        this.text = texte;
        this.placement = [];
        console.log(texte)
}
Shape.prototype.getValue = function(){
        console.log(this.text, this.x, this.y)
         context.textAlign = "left";
         context.font =  this.size + "px arial";
         context.fillStyle = "#ffffff";
         context.fillText(this.text, this.x, this.y);
        


         var idata = context.getImageData(0, 0, W, H);
         var buffer32 = new Uint32Array(idata.data.buffer);

         for(var j=0; j < H; j += gridY){
             for(var i=0 ; i < W; i += gridX){
                 if(buffer32[j * W + i]){
//                      var particle = new Particle(i, j, type);
//                      this.placement.push(particle);
                     var r = Math.random()*10;
                     var col = utils.getRandomColor();
                     var spend = parseFloat((Math.random()*0.01).toFixed(3)==0?0.01:(Math.random()*0.1).toFixed(2));
                     var particle = new Ball(0.1, col);
                     particle.x = i;
                     particle.y = j;
                     particle.spend = spend;
                     console.log(particle)
                    this.placement.push(particle);
                     context.clearRect(0, 0, W, H);
                 }
             }
         }
         
         //context.clearRect(0, 0, W, H);
}